package com.qingcloud.api.dcengine.service.factory;


import com.qingcloud.api.dcengine.service.DischargeApi;
import com.qingcloud.api.dcengine.service.fallback.DischargeFallback;
import org.springframework.cloud.openfeign.FallbackFactory;
import org.springframework.stereotype.Component;

@Component
public class DischargeFallbackFactory implements FallbackFactory<DischargeApi> {
    @Override
    public DischargeApi create(Throwable throwable) {
        DischargeFallback fallback = new DischargeFallback();
        fallback.setCause(throwable);
        return fallback;
    }
}
